package fauxman.ClydeStates;

import fauxman.DynamicElements.Ghost;
import fauxman.model.WorldModel;
import fauxman.states.GhostHouseState;
import fauxman.states.LeavingHouseState;
import fauxman.utilities.SpriteUtil;

public class EnteringHouseClydeState extends GhostHouseState{
	private static EnteringHouseClydeState instance;
	private static int[] target = {16, 14}; 
	
	private EnteringHouseClydeState(){
	}
	
	public static EnteringHouseClydeState getInstance(){
		if (instance==null)
			instance = new EnteringHouseClydeState();
		return instance;
	}
	
	public void setAppearance(int appearanceID, Ghost g) {
		g.setAppearance(SpriteUtil.getEatenSprite(appearanceID));
	}
	
	public int[] getTarget(WorldModel model, Ghost g) {
		return target;
	}
	@Override
	public void reactToCurrentDiscretePosition(WorldModel model, Ghost g){
		if(g.getDiscretePosition().x == target[0] && g.getDiscretePosition().y == target[1]){
			System.out.println("Ghost \""+ g + "\" changing to EnteringGhostHouseState");
			g.hitGhostHouseTarget(LeavingHouseState.getInstance());
		}
	}
}
